home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 666 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  2.0 KB

  1. Path: mail2news.demon.co.uk!seacloud.demon.co.uk
  2. From: Ben Ashley <Ben@seacloud.demon.co.uk>
  3. Newsgroups: comp.lang.c++
  4. Subject: Variable Problems
  5. Date: Fri, 05 Jan 96 17:57:56 GMT
  6. Organization: home, in Leicester, England
  7. Message-ID: <820864676snz@seacloud.demon.co.uk>
  8. Reply-To: Ben@seacloud.demon.co.uk
  9. X-NNTP-Posting-Host: seacloud.demon.co.uk
  10. X-Newsreader: Demon Internet Simple News v1.29
  11. X-Mail2News-Path: seacloud.demon.co.uk
  12.  
  13. Hi,
  14.  
  15. I am very new to C++, and for my first project I decided to develop and MS-DOS
  16. game.  A friend recommended MSVC, and so I purchased that.  I have got the
  17. hang of classes and such like, and the GUI for the game is going very well and
  18. it even has mouse support.
  19.  
  20. The only problem Im having, is that some variables seem to be getting over
  21. written during execution, without me saying so.  Using Codeview, I have
  22. determined that this is happening after excessive class calls (ie, a line of
  23. code is accessing several classes within classes many times).  The variables
  24. that are getting over written are members of the same parent class as the
  25. classes which seem to be killing them.  Judging by the new value of the
  26. variable I don't want to be changed at that point, I think the value may be
  27. coming from a member of the aforementioned class calls.
  28.  
  29. I have checked the code throughly, and found, as I suspected, that I have only
  30. set these variables once (in a constructor), and not again afterwards.  I was
  31. wondering if anybody out there knew why this was happening, and if there were
  32. any more checks or a solution I could use to stop it happening.
  33.  
  34. Sorry if its obvious.  if anyone needs to look at the class definitions, I can
  35. post (or Email) them.
  36.  
  37. Hope somebody can help!
  38.  
  39. -- 
  40. Cheers,
  41.  
  42. Ben
  43.  
  44. ------------------====### legal notice ###====-----------------------
  45. Microsoft Network is prohibited from redistributing this work in any
  46. form,in whole or in part.  License to distribute this post is available to
  47. Microsoft for $499.  Posting without permission constitutes an agreement to
  48. these terms.
  49.